import request from '@/utils/request'

/* *
 * 获取商品分类数据列表
 */
export const getGoodsCate = params =>
  request({
    url: 'categories',
    params
  })

/* *
 * 增加分类
 */
export const addGoodsCate = data =>
  request({
    method: 'POST',
    url: 'categories',
    data
  })

/* *
 * 编辑提交分类
 */
export const editGoodsCate = (id, data) =>
  request({
    method: 'PUT',
    url: `categories/${id}`,
    data
  })

/* *
 * 删除分类
 */
export const deleteGoodsCateById = id =>
  request({
    method: 'DELETE',
    url: `categories/${id}`
  })
